#pragma once
#include "mem.h"
struct data_struct
{
	char name[20];
	int  idex;
	bool Direction;
	double  price;
};
class CMatch
{
public:
	CMatch(void);
	~CMatch(void);

	struct OrderNode
	{
		data_struct *data;
		OrderNode*  next;
		OrderNode*  prev;
	};

	struct PriceNode
	{
		int price;
		OrderNode* order_head;
		OrderNode* order_tail;
		PriceNode* next;
	};
public:
	int InsertOrder(data_struct* data);
	int CancelOrder(data_struct* data);
	void PrintOrder();
private:
	PriceNode* _ask_list;
	PriceNode* _bid_list;

	MemCache<PriceNode, 50, 50> _price_node_mem;
	MemCache<OrderNode, 100, 100> _order_node_mem;
};
